<div class='course-list' ng-controller='CourseIndex'>
    <div class='goods am-g am-g-collapse' ng-repeat='course in course.list'>
        <div class='am-u-sm-4 banner' ng-click='detail(course.id)'>
            <img ng-src='{{course.banner}}'>
            <div class='tag'>
                <img src='../image/tag/hot.png' ng-if='course.tag == 1'>
                <img src='../image/tag/new.png' ng-if='course.tag == 2'>
            </div>
        </div>
        <div class='am-u-sm-7 info' ng-click='detail(course.id)'>
            <div class='name'>{{course.name}}</div>
            <div class='intro font-info'>
                <img class='icon' src='../image/icon/user.png' align="absmiddle">
                {{course.teacher_name}} 共{{course.chapter}}章节
            </div>
            <div class='buy-count font-info'>
                <span ng-if='course.price == 0'>{{course.buy_count}}人已体验</span>
                <span ng-if='course.price != 0'>{{course.buy_count}}人已购买</span>
            </div>
            <div class='price-money font-info'>
                <img class='icon' src='../image/icon/money.png' align="absmiddle">{{course.price}}
            </div>
        </div>
        <div class='box-cart-ops' ng-if='course.buy_status == 0 && course.in_cart'
                ng-click='cart_ops(course, "minus")'>
            <div class='cart-ops-icon fa fa-minus'></div>
        </div>
        
        <div class='box-cart-ops' ng-if='course.buy_status == 0 && !course.in_cart' 
                ng-click='cart_ops(course, "add")'>
            <div class='cart-ops-icon fa fa-plus'></div>
        </div>

        <button class='button btn-buy' ng-click='buy_course(course.id, course)' ng-if='course.buy_status == 0'>
            立即抢购
        </button>

        <button class='button btn-go' ng-click='listen(course.id, course.play_type)' 
            ng-if='course.buy_status == 1 || course.buy_status == 3'>
            去听课
        </button>
        <button class='button btn-go' ng-click='buy_course(course.id, course)' ng-if='course.buy_status == 1001'>
            免费体验
        </button>
    </div>
    <div class='load-more' ng-click='load_data()' ng-if='!course.is_end'>加载中...</div>

    <img src='../image/course/course-intro.jpg' width='100%' ng-if='course.list.length == 0 && course.is_end'>
    
    <div style='height: 60px'></div>
    <div class='box-cart am-g am-g-collapse' ng-if='cart.amount'>
        <div class='am-u-sm-3 icon'>
            <img src='../image/course/shop-cart.png'>
            <span>{{cart.count}}</span>
        </div>
        <div class='am-u-sm-5 tip'>
            总金额:<span class='amount'>¥{{cart.amount}}</span>
        </div>
        <div class='am-u-sm-4'>
            <button class='am-btn am-btn-warning am-btn-block' ng-click='cart_settle()'>查看购物车</button>
        </div>
    </div>
</div>